package entities;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

@Entity
@Table(name="ticket")
@NamedQueries({
	@NamedQuery(name="findBiletByStatus", 
					query="SELECT e FROM Bilet e WHERE e.status = :statusParam"),
	@NamedQuery(name="findBiletByEmployee", 
					query="SELECT e FROM Bilet e WHERE e.empl_id = :usernameParam"),
	/*@NamedQuery(name="findBiletByPeriod", 	
	 * 				query="SELECT e FROM Bilet e WHERE e.period = :periodParam"),*/
	@NamedQuery(name="findAllTickets", 
					query="SELECT b FROM Bilet b WHERE b.tl_id=:tl_idParam AND b.status=:statusParam"),
	@NamedQuery(name="findAllTickets2", 
					query="SELECT b FROM Bilet b WHERE b.empl_id=:empl_idParam"),
	@NamedQuery(name="findBiletByStatusAndEmployee",
					query="SELECT b FROM Bilet b WHERE b.status=:status_Param AND b.empl_id=:idParam")
	//@NamedQuery(name="findBiletByPeriod",
	//				query="SELECT e FROM Bilet e WHERE e.period = :periodParam")
})
public class Bilet implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	@Id
	private int id;
	
	private int empl_id; // id angajat
	
	private String status; // 1 - aprobat 2 - refuzat 0 - trimis
	
	private String start_time; // numar de ore
	
	private String end_time;
	
	private String motiv;
	
	private int tl_id;
	
	private String firstname;
	
	private String lastname;
	
	public Bilet(){
		super();
	}
	
	public Bilet(int id, int empl_id, String status, String start_time, String end_time, String motiv, int tl_id, String firstname, String lastname){
		this.id = id;
		this.empl_id = empl_id;
		this.status = status;
		this.start_time = start_time;
		this.end_time = end_time;
		this.motiv = motiv;
		this.tl_id = tl_id;
		this.firstname = firstname;
		this.lastname = lastname;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getEmpl_id() {
		return empl_id;
	}

	public void setEmpl_id(int empl_id) {
		this.empl_id = empl_id;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String string) {
		this.status = string;
	}

	

	public String getMotiv() {
		return motiv;
	}

	public void setMotiv(String motiv) {
		this.motiv = motiv;
	}

	public String getStart_time() {
		return start_time;
	}

	public void setStart_time(String start_time) {
		this.start_time = start_time;
	}

	public String getEnd_time() {
		return end_time;
	}

	public void setEnd_time(String end_time) {
		this.end_time = end_time;
	}

	public int getTl_id() {
		return tl_id;
	}

	public void setTl_id(int tl_id) {
		this.tl_id = tl_id;
	}

	public String getFirstname() {
		return firstname;
	}

	public void setFirstname(String firstname) {
		this.firstname = firstname;
	}

	public String getLastname() {
		return lastname;
	}

	public void setLastname(String lastname) {
		this.lastname = lastname;
	}
	

}
